翻訳と辞書
Words near each other
・ C'mon, C'mon
・ C'mon, Have A Go!
・ C'mon, Let's Live a Little
・ C'mon/Jo-Anna Says
・ C'rizz
・ C's
・ C's Ware
・ C't
・ C'è sempre un ma!
・ C'était ici
・ C'était un rendez-vous
・ C Star class airship
・ C Stock
・ C Street Center
・ C string (disambiguation)
C string handling
・ C syntax
・ C tactile afferent
・ C The Contra Adventure
・ C to HDL
・ C Train
・ C Traps and Pitfalls
・ C Tuckey
・ C tuning (guitar)
・ C TV
・ C U When U Get There
・ C US Bank
・ C V Seshadri
・ C Velorum
・ C venues


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

C string handling : ウィキペディア英語版
C string handling

The C programming language has a set of functions implementing operations on strings (character strings and byte strings) in its standard library. Various operations, such as copying, concatenation, tokenization and searching are supported. For character strings, the standard library uses the convention that strings are null-terminated: a string of characters is represented as an arrays of an elements, the last of which is a "NUL" character.
The only support for strings in the programming language proper is that the compiler translates quoted string constants into null-terminated strings.
== Definitions==
A string is a contiguous sequence of code units terminated by the first zero code (\0, corresponding to the null character). In C, there are two types of strings: string, which is sometimes called byte string which uses the type chars as code units (one char is at least 8 bits), and wide string〔(【引用サイトリンク】url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf )〕 which uses the type wchar_t as code units.
A common misconception is that all char arrays are strings, because string literals are converted to arrays during the compilation (or translation) phase.〔(【引用サイトリンク】url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf )〕 It is important to remember that a string ends at the first zero code unit. An array or string literal that contains a zero before the last byte therefore ''contains'' a string, or possibly several strings, but is not itself a string.〔(【引用サイトリンク】url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf )〕 Conversely, it is possible to create a char array that is not null-terminated and is thus not a string: char is often used as a small integer when needing to save memory.
The term pointer to a string is used in C to describe a pointer to the initial (lowest-addressed) byte of a string.〔 In C, pointers are used to pass strings to functions. Documentation (including this page) will often use the term ''string'' to mean ''pointer to a string''.
The term length of a string is used in C to describe the number of bytes preceding the zero byte.〔 strlen is a standardised function commonly used to determine the length of a string. A common mistake is to not realize that a string uses one more unit of memory than this length, in order to store the zero that ends the string.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「C string handling」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.